# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-daphne
_pkgreal=daphne
pkgver=4.1.2
pkgrel=0
pkgdesc="HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP"
url="https://github.com/django/daphne"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-twisted
	py3-autobahn
	py3-asgiref
"
checkdepends="
	py3-hypothesis
	py3-django
	py3-cryptography
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-runner
"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/django/daphne/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgreal-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}


sha512sums="
2be34cd2474068a31bd88363d4f9a4c0bb1f3209c52e9381e67649c6d4ca4f08186481ee57f59fd70689340e3fda287cc4907c1dc4dccd109b1c37119b30b9f2  py3-daphne-4.1.2.tar.gz
"
